<!--
 * @Author: HeAo
 * @Date: 2021-10-15 17:07:31
 * @LastEditTime: 2021-10-15 17:33:29
 * @LastEditors: HeAo
 * @Description: 
 * @FilePath: \web2103-2105\web2103code\3-2-Vue\day07\8-封装的使用.html
 * 别乱动！
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../js/axios.js"></script>
  <script src="../js/qs.js"></script>
  <script src="./7-axios封装.js"></script>
  <script>
    axios.post('/user/login', {
      username: 'admin1',
      password: 123321
    }).then(res => {
      if (res.status != 200) {
        console.error(res.statusText)
        return false
      }
      sessionStorage.setItem('token', res.data.token)
    }).catch(error => {
      console.log('失败', error);
    })

    axios.get('/index/category/findAll').then(res => {
      console.log(res.data);
    })

    post_form('/category/saveOrUpdate', {
      name: '体坛赛事'
    }).then(res => {
      console.log(res.statusText);
    })

    // myget('url')
    // myget('url', { page: 1, pageSize: 10 })
    // post_json('url', {
    //   username: 'admin1',
    //   password: 123321
    // })

  </script>
</head>

<body>

</body>

</html>